package com.clarence.dada.modular.system.menu.entity.req;

import com.clarence.dada.core.base.BaseReq;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 系统菜单参数
 *
 * @author GD
 * @since 2020/3/26 20:42
 */
@Data
@Schema(title = "系统菜单请求实例")
@EqualsAndHashCode(callSuper = true)
public class SysMenuReq extends BaseReq {

    /**
     * 主键
     */
    @NotNull(message = "menuId不能为空", groups = {edit.class, delete.class, detail.class})
    @Schema(title = "主键", example = "1")
    private Long menuId;

    /**
     * 父id
     */
    @NotNull(message = "menuParentId不能为空", groups = {add.class, edit.class})
    @Schema(title = "父id", example = "-1")
    private Long menuParentId;

    /**
     * 菜单名称
     */
    @NotBlank(message = "菜单名称不能为空", groups = {add.class, edit.class})
    @Schema(title = "菜单名称", example = "菜单")
    private String menuName;

    /**
     * 菜单的编码
     */
    @NotBlank(message = "菜单的编码不能为空", groups = {add.class, edit.class})
    @Schema(title = "菜单的编码", example = "menuCode")
    private String menuCode;

    /**
     * 应用分类（应用编码）
     */
    @NotBlank(message = "appCode不能为空", groups = {add.class, edit.class, getAppMenus.class})
    @Schema(title = "应用分类（应用编码）", example = "systemApp")
    private String appCode;

    /**
     * 是否可见（Y-是，N-否）
     */
    @Schema(title = "是否可见（Y-是，N-否）", example = "Y")
    private String visible;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {add.class, edit.class})
    @Schema(title = "排序", example = "1")
    private BigDecimal menuSort;

    /**
     * 备注
     */
    @Schema(title = "备注", example = "备注")
    private String remark;


    /**
     * 路由地址，浏览器显示的URL
     */
    @Schema(title = "路由地址，浏览器显示的URL", example = "/menu")
    private String router;

    /**
     * 图标
     */
    @Schema(title = "图标", example = "icon")
    private String icon;

    /**
     * 前端组件名
     */
    @Schema(title = "前端组件名", example = "/system/app/app")
    private String component;

    /**
     * 外部链接打开方式：1-内置打开外链，2-新页面外链
     */
    @Schema(title = "外部链接打开方式：1-内置打开外链，2-新页面外链", example = "/system/app/app")
    private Integer linkOpenType;

    /**
     * 外部链接地址
     */
    @Schema(title = "外部链接地址", example = "www.baidu.com")
    private String linkUrl;

    /**
     * 用于非菜单显示页面的重定向url设置
     */
    @Schema(title = "用于非菜单显示页面的重定向url设置", example = "/aaa")
    private String activeUrl;

    /**
     * 获取主页左侧菜单列表
     */
    public @interface getAppMenus {
    }

}
